//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.andromeda.androbench2;

import android.app.Activity;
import android.graphics.Typeface;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.view.ViewGroup.MarginLayoutParams;
import android.widget.Button;
import android.widget.TextView;

public class CustomActivity extends Activity {
    private static Typeface bold_typeface = null;
    private static Typeface bolditalic_typeface = null;
    private static Typeface italic_typeface = null;
    private static Typeface regular_typeface = null;

    public CustomActivity() {
    }

    static void setGlobalFont(ViewGroup var0) {
        for (int var1 = 0; var1 < var0.getChildCount(); ++var1) {
            View var2 = var0.getChildAt(var1);
            if (var2 instanceof TextView) {
                TextView var3 = (TextView) var2;
                if (var3.getTypeface() == null) {
                    var3.setTypeface(regular_typeface);
                } else if (var3.getTypeface().getStyle() == 3) {
                    var3.setTypeface(bolditalic_typeface);
                } else if (var3.getTypeface().getStyle() == 1) {
                    var3.setTypeface(bold_typeface);
                } else if (var3.getTypeface().getStyle() == 2) {
                    var3.setTypeface(italic_typeface);
                } else {
                    var3.setTypeface(regular_typeface);
                }
            } else if (var2 instanceof ViewGroup) {
                setGlobalFont((ViewGroup) var2);
            }
        }

    }

    static void setSelector(ViewGroup var0) {
        for (int var1 = 0; var1 < var0.getChildCount(); ++var1) {
            View var2 = var0.getChildAt(var1);
            if (var2 instanceof Button) {
                Button var3 = (Button) var2;
                var3.setBackgroundResource(R.drawable.custom_button_selector);
                LayoutParams var4 = var3.getLayoutParams();
                var4.height = -1;
                ((MarginLayoutParams) var3.getLayoutParams()).setMargins(20, 0, 20, 20);
                var3.setLayoutParams(var4);
            } else if (var2 instanceof ViewGroup) {
                setSelector((ViewGroup) var2);
            }
        }

    }

    public void setContentView(int var1) {
        super.setContentView(var1);
        if (regular_typeface == null) {
            regular_typeface = Typeface.createFromAsset(this.getAssets(), "fonts/PT_Sans-Web-Regular.ttf");
            bold_typeface = Typeface.createFromAsset(this.getAssets(), "fonts/PT_Sans-Web-Bold.ttf");
            italic_typeface = Typeface.createFromAsset(this.getAssets(), "fonts/PT_Sans-Web-Italic.ttf");
            bolditalic_typeface = Typeface.createFromAsset(this.getAssets(), "fonts/PT_Sans-Web-BoldItalic.ttf");
        }

        setGlobalFont((ViewGroup) this.findViewById(android.R.id.content));
    }
}
